﻿@model IEnumerable<Microsoft.Online.Demos.Aadexpense.Models.Invoice>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Invoices Awaiting Your Approval</h2>

<table>
    <tr>
        <th>
            Employee
        </th>
        <th>
            Reason
        </th>
        <th>
            SubmitDate
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Employee)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Reason)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.SubmitDate)
        </td>
        <td>
            @Html.ActionLink("Details", "Details", new { id=item.InvoiceID }) |
            @Html.ActionLink("Approve", "Approve", new { id=item.InvoiceID }) |
            @Html.ActionLink("Reject", "Reject", new { id=item.InvoiceID }) 
        </td>
    </tr>
}

</table>
